<?php
require_once '../model/logticket.php';
session_start(); 
$link = mysql_connect("localhost", "root", "1234");
mysql_select_db("busticket", $link);
mysql_query("SET NAMES UTF8");
$query = "select * from logticket where memberid = ".$_SESSION['memberid']."";
$result = mysql_query($query,$link);
$_SESSION['detail'] = array();
$_SESSION['profit'] = 0;
while ($object = mysql_fetch_object($result)){
	$_SESSION['profit'] += $object->price;
	$_SESSION['detail'][] = new LogTicket($object->memberid, $object->price, $object->detail);
}
mysql_close($link);
echo "<script>location.href='../view/buydetail.php'</script>";
?>